
$(function() {

	var _email_option = {
		rules: {
			email: {
				remote: "customer.php?do=Email.ajax_email"
			},
			tel: {
				tel: true
			},
			contact: "required"
		},
		messages: {
			email: {
				remote: jQuery.format("{0} 已经存在")
			}
		},
		errorPlacement: function(label, element) {
			label.insertAfter(element);
		},
		success: function(label) {
			label.html("&nbsp;").addClass("checked");
		}
	};
	
	$("#email").change(function() {	
		var body = { };
		body.email = $(this).val();
		
		$.post('info.php?do=Contact.ajax_count', body, function(data) {
			$("#email").after(data);
		});
    });
	
	$("#form_add").validate(_email_option);
	$("#form_edit").validate(_email_option);
	
	$('textarea').css("width", 400);
});